﻿///////////////////////////////////////////////////////////////////////////
//  Copyright(c) 2023, GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007
//
/// @file    button.h
/// @brief   UI-按钮
/// @version 0.1
/// @history 修改历史
/// @warning 没有警告
///////////////////////////////////////////////////////////////////////////
#include "element_ui/elements_ui.h"
#include "klbmem/klb_mem.h"


typedef struct button_t_
{
    int a;
}button_t;


//////////////////////////////////////////////////////////////////////////



//////////////////////////////////////////////////////////////////////////

/// @brief 销毁
void button_destroy(geobj_t* p_obj)
{
    button_t* p_btn = (button_t*)p_obj->extra;

    KLB_FREE(p_obj);
}

/// @brief 向object设置数据
int on_button_set(geobj_t* p_obj, const klb_map_t* p_map)
{
    button_t* p_btn = (button_t*)p_obj->extra;

    return 0;
}

/// @brief 向object获取数据
klb_map_t* on_button_get(geobj_t* p_obj, const klb_map_t* p_map)
{
    button_t* p_btn = (button_t*)p_obj->extra;

    return NULL;
}

//////////////////////////////////////////////////////////////////////////

geobj_t* button_create()
{
    geobj_t* p_obj = KLB_MALLOCZ(geobj_t, 1, sizeof(button_t));
    button_t* p_btn = (button_t*)p_obj->extra;

    p_obj->vtable.cb_destroy = button_destroy;
    p_obj->vtable.cb_set = on_button_set;
    p_obj->vtable.cb_get = on_button_get;

    return p_obj;
}
